<?php
/**
 * elimina/evita cache
 * Enter description here ...
 * @var unknown_type
 */
$parDados['ge9'] = gmdate('D, d M Y H:i:s');
header("Expires: " . $parDados['ge9'] . " GMT");
header("Last Modified: " . $parDados['ge9'] . " GMT");
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');
header('Expires: 0');
header("Content-Type: text/html; charset=utf-8");
/**
 * inclui arquivo de configuracao
 */
include_once '../../../../../configuracao.php';
/**
 * resposta ajax
 */
print "<div id=\"gridDivEditaPostId\" style=\"display: none;\"></div>";
/**
 * verifica post e loop do mesmo
 */
if (isset($_POST) && !empty($_POST))
	{
		$parDados['ge6'] = json_decode($_POST[0], true);
		$parDados['ge7'] = json_decode($_POST[1], true);
		foreach ($parDados['ge6'] as $parDados['ge1'] => $parDados['ge2'])
			{
				if ($parDados['ge2']['parTipo'] == 'text')
					{
						$parDados['ge3'][] = "" . $parDados['ge2']['parNome'] . ": <input type=\"" . $parDados['ge2']['parTipo'] . "\" name=\"" . $parDados['ge2']['parId'] . "\" id=\"" . $parDados['ge2']['parId'] . "\" value=\"" . $parDados['ge2']['parIdValor'] . "\"><br>";
					}
			}
		foreach ($parDados['ge7'] as $parDados['ge8'] => $parDados['ge9'])
			{
				$parDados['ge3'][] = "<input type=\"hidden\" name=\"" . $parDados['ge9']['parId'] . "\" id=\"" . $parDados['ge9']['parId'] . "\" value=\"" . $parDados['ge9']['parIdValor'] . "\">";
			}
		$parDados['ge5'] = "<form method=\"post\" name=\"gridFormEditarNome\" id=\"gridFormEditarId\" action=\"javascript:void();\">";
		foreach ($parDados['ge3'] as $parDados['ge4'])
			{
				$parDados['ge5'] .= $parDados['ge4'];
			}
		$parDados['ge5'] .= "<input type=\"submit\" name=\"botao\" value=\"salvar\" onclick=\"mtdGridEditarPost(event, ['gridFormEditarId', 'gridDivEditaPostId']);\"></form>";
		print $parDados['ge5'];
	}
?>